package sample;

import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import sample.model.ExtremeData;

import java.io.Serializable;

public class TableViewController implements Serializable {

    public TableView<ExtremeData> tableView_extreme;

    public TableColumn<ExtremeData, String> tc_station;
    public TableColumn<ExtremeData, String> longtude;
    public TableColumn<ExtremeData, String> latitude;
    public TableColumn<ExtremeData, String> tc_HB;
    public TableColumn<ExtremeData, String> tc_typeId;
    public TableColumn<ExtremeData, String> tc_hour;
    public TableColumn<ExtremeData, String> tc_DBT;
    public TableColumn<ExtremeData, String> tc_HSL;
    public TableColumn<ExtremeData, String> tc_RH;
    public TableColumn<ExtremeData, String> tc_TH;
    public TableColumn<ExtremeData, String> tc_DF;
    public TableColumn<ExtremeData, String> tc_WBT;
    public TableColumn<ExtremeData, String> tc_DPT;
    public TableColumn<ExtremeData, String> tc_VP;
    public TableColumn<ExtremeData, String> tc_EP;
    public TableColumn<ExtremeData, String> tc_NR;
    public TableColumn<ExtremeData, String> tc_EH;
    public TableColumn<ExtremeData, String> tc_SH;
    public TableColumn<ExtremeData, String> tc_WH;
    public TableColumn<ExtremeData, String> tc_NH;
    public TableColumn<ExtremeData, String> tc_VT;
    public TableColumn<ExtremeData, String> tc_ET;
    public TableColumn<ExtremeData, String> tc_WS;
    public TableColumn<ExtremeData, String> tc_AP;
    public TableColumn<ExtremeData, String> tc_WD;
    public void init(){
        /**
         *  private int station_no;
         *     private double longtude;
         *     private double latitude;
         *     private double HB;
         *     private int type_id;
         *     private int hour;
         *     private double DBT;
         *     private double RH;
         *     private double HSL;
         *     private double TH;
         *     private double DF;
         *     private double WBT;
         *     private double DPT;
         *     private double VP;
         *     private double EP;
         *     private double NR;
         *     private double EH;
         *     private double SH;
         *     private double WH;
         *     private double NH;
         *     private double VT;
         *     private double ET;
         *     private double WS;
         *     private double WD;
         *     private double AP;
         */
        tc_station.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("station_no"));
        longtude.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("longtude"));
        latitude.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("latitude"));
        tc_HB.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("HB"));
        tc_typeId.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("type_id"));
        tc_hour.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("hour"));
        tc_DBT.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("DBT"));
        tc_HSL.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("HSL"));
        tc_RH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("RH"));
        tc_TH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("TH"));
        tc_DF.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("DF"));
        tc_WBT.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("WBT"));
        tc_DPT.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("DPT"));
        tc_VP.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("VP"));
        tc_EP.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("EP"));
        tc_NR.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("NR"));
        tc_EH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("EH"));
        tc_SH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("SH"));
        tc_WH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("WH"));
        tc_NH.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("NH"));
        tc_VT.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("VT"));
        tc_ET.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("ET"));
        tc_WS.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("WS"));
        tc_AP.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("AP"));
        tc_WD.setCellValueFactory(new PropertyValueFactory<ExtremeData,String>("WD"));
    }
}
